package com.trainsmart.smartmvc
{
	import mx.core.Container;
	
	public class FlowControl extends CtrlBase
	{
		private var _container:Container;
		private var _form:SmartForm = null;
		private var _keepValue:Boolean = false;
		public function FlowControl(context:Context,container:Container,viewId:String,keepValue:Boolean)
		{
			super(context);
			_container = container;
			_keepValue = keepValue;
			_form = context.getView(viewId);
		}
		
		override public function execute(request:Object, response:Function):void
		{
			if(_keepValue)
				_form.data = request;
			_container.removeAllChildren();
			_container.addChild(_from);
			if(response!=null){
				response(request);
			}			
		}
		
		
	}
}